import { createRouter, createWebHistory } from 'vue-router'
import LayoutView from "@/views/layout/LayoutView.vue"
import HomeView from "@/views/home/HomeView.vue"
import ShopView from "@/views/shop/ShopView.vue"
import CartView from  "@/views/cat/CartView.vue"
import OrderView from "@/views/order/OrderView.vue"
import MyView from '@/views/my/MyView.vue'
import AddressView from '@/views/address/AddressView.vue'
import OrderConfirmationView from '@/components/order/OrderConfirmationView.vue'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: LayoutView,
      redirect:'/home',
      children:[
        {
          name:'home',
          path:'home',
          component:HomeView
        },
        {
          name:'cart',
          path:'cart',
          component:CartView
        },
        {
          name:'order',
          path:'order',
          component:OrderView
        },
        {
          name:'my',
          path:'my',
          component:MyView
        }
        
        
      ]
    },
    {
      path: '/shop',
      name: 'shop',
      component: ShopView,
      props:true
    },
    {
      path:'/orderConfirm',
      component:OrderConfirmationView
    },
    {
      path:'/address',
      component:AddressView
    }
  ]
})

export default router
